package com.company.cloud.company.modules.api.fallback;


import com.company.cloud.common.bean.BaseClientResult;
import com.company.cloud.company.modules.api.request.*;
import com.company.cloud.company.modules.api.response.*;
import com.company.cloud.company.modules.api.service.CompanyRemoteService;
import feign.hystrix.FallbackFactory;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.Set;

@Log4j2
@Component
public class CompanyRemoteServiceFallbackFactory  implements FallbackFactory<CompanyRemoteService> {
    @Override
    public CompanyRemoteService create(Throwable cause) {
        return new CompanyRemoteService() {

            @Override
            public BaseClientResult<CompanySimple> getCompanySimple(String companyNo) {
                log.debug("CompanyRemoteService.getCompanySimple callFallBack");
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<Map<String, CompanySimple>> getCompanyMapSimple(Set<String> companyNos) {
                log.debug("CompanyRemoteService.getCompanyMapSimple callFallBack ");
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<CompanyFull> getCompanyFull(String companyNo) {
                log.debug("CompanyRemoteService.getCompanyFull callFallBack ");
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<Map<String, CompanyFull>> getCompanyMapFull(Set<String> companyNos) {
                log.debug("CompanyRemoteService.getCompanyMapFull callFallBack ");
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<CompanyFullPage> queryCompanyFull(CompanyQueryRequest request) {
                log.debug("CompanyRemoteService.queryCompanyFull callFallBack ");
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<CompanyFull> addCompany(CompanyAddRequest request) {
                log.debug("CompanyRemoteService.addCompany callFallBack ");
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<CompanyFull> addCompany2User(Company2UserAddRequest request) {
                log.debug("CompanyRemoteService.addCompany2User callFallBack ");
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<CompanyFull> updateCompany(CompanyUpdateRequest request) {
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<CompanyFull> delCompany(CompanyDelRequest request) {
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<CompanyFull> checkCompany(CompanyCheckRequest request) {
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<CompanyFull> frozenCompany(CompanyFrozenRequest request) {
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<CompanyFull> unfreezeCompany(CompanyUnFreezeRequest request) {
                return BaseClientResult.callbackError();
            }
        };
    }
}
